<ng-template #extra>
    <button nz-button (click)="handleCancel()" style="margin-right: 10px">
        取消
    </button>
    <button nz-button nzType="primary" (click)="submit()">
        <i nz-icon nzType="save" nzTheme="outline"></i>
        保存
    </button>
</ng-template>

<nz-card [nzTitle]="id ? '编辑计划任务' : '创建计划任务'" [nzExtra]="extra">
    <form nz-form [formGroup]="group" (ngSubmit)="submit()">

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="product_id">产品id</nz-form-label>
            <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="">
                <nz-select formControlName="product_id" [nzOptions]="productList">
                </nz-select>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="name">名称</nz-form-label>
            <nz-form-control [nzSm]="14" [nzXs]="24">
                <input nz-input formControlName="name"/>
            </nz-form-control>
        </nz-form-item>


        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="desc">说明</nz-form-label>
            <nz-form-control [nzSm]="14" [nzXs]="24">
                <input nz-input formControlName="desc"/>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="crontab">定时任务</nz-form-label>
            <nz-form-control [nzSm]="14" [nzXs]="24">
                <input nz-input formControlName="crontab"/>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="expression">表达式</nz-form-label>
            <nz-form-control [nzSm]="14" [nzXs]="24">
                <input nz-input formControlName="expression"/>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="type">类型</nz-form-label>
            <nz-form-control [nzSm]="14" [nzXs]="24">
                <nz-select formControlName="type" [nzOptions]="types"></nz-select>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="assign">分配</nz-form-label>
            <nz-form-control [nzSm]="14" [nzXs]="24">
                <input nz-input formControlName="assign"/>
            </nz-form-control>
        </nz-form-item>

    </form>
</nz-card>
